/****************************************************************************
*                                                                           *
* matrepository.h										                    *
*                                                                           *
* ALaRI 2008												                *
*                                                                           *
****************************************************************************/
#pragma once

#if !defined(__MATREPOSITORY_H)
#define __MATREPOSITORY_H

/****************************************************************************
* Includes										                            *
****************************************************************************/
#include "material.h"
#include "../../common/repository.h"
#include "../../common/defs.h"
#include <list>
#include <QList>
#include <QString>

class CMaterialRepository : public CRepository<CMaterialRepository, unsigned int, CMaterial*> 
{
public :
	void init();
	void destroy() { destroyInstance(); }
	
	static CMaterialRepository* inst() 
		{ return (dynamic_cast<CMaterialRepository*>(getInstance())); } 

	QList<QString> getQListNames();

	QList<CMaterial*> toQList() const;
	std::list<CMaterial*> toStdList() const;

	CMaterial* getMaterial(unsigned int nColor);
	CMaterial* getMaterial(const QString& qStrName);

	void addMaterial(CMaterial *pMaterial);

};

#endif /* __MATREPOSITORY_H */
/****************************************************************************
* End of file																*
****************************************************************************/